#include "addstationdialog.h"
#include "ui_addstationdialog.h"

#include "StationManagement.h"

AddStationDialog::AddStationDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddStationDialog)
{
    ui->setupUi(this);
}

AddStationDialog::~AddStationDialog()
{
    delete ui;
}

void AddStationDialog::on_buttonBox_accepted()
{
    QString stationName = ui->stationNameContent_edit->text();

    if(stationName.isNull() || stationName.isEmpty())
        return;

    StationManagement::addStation(stationName);
}
